package com.yuan.pojo;

import lombok.AllArgsConstructor;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Value;


@AllArgsConstructor
@ToString
public class Student {


    private Integer id;
    @Value("张三")
    private String name;
    @Value("29")
    private Integer age;


    public Integer getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public Integer getAge() {
        return age;
    }

    public Student() {
        System.out.println("==>2.Student对象创建啦!!!");
    }

    public void initStudent(){
        System.out.println("==>4.初始化student!!!");
    }
    public void destroyStudent(){
        System.out.println("==>6. 销毁student!!!");
    }

    @Value("1001")
    public void setId(Integer id) {
        System.out.println("3. 为目标对象设置属性setXXX() !");
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(Integer age) {
        this.age = age;
    }


}
